package com.example.service;

import com.example.common.Pager;
import com.example.exception.LibraryManagerException;

import java.util.List;

/**
 * @author 紫煦桉
 */
public interface SuperService<T> {
    /**
     * list 方法
     *
     * @param pager
     * @return
     * @throws LibraryManagerException
     */
    List<T> findList(Pager<T> pager) throws LibraryManagerException;

    /**
     * findTotal 方法
     *
     * @param pager
     * @return
     * @throws LibraryManagerException
     */
    int findTotal(Pager<T> pager) throws LibraryManagerException;

    /**
     * findAll 方法
     *
     * @return
     * @throws LibraryManagerException
     */
    List<T> findAll() throws LibraryManagerException;

    /**
     * add 方法
     *
     * @param param
     * @return
     * @throws LibraryManagerException
     */
    boolean add(T param) throws LibraryManagerException;

    /**
     * edit 方法
     *
     * @param param
     * @return
     * @throws LibraryManagerException
     */
    boolean edit(T param) throws LibraryManagerException;

    /**
     * delete 方法
     *
     * @param param
     * @return
     * @throws LibraryManagerException
     */
    boolean delete(T param) throws LibraryManagerException;
}
